const { Sequelize } = require('sequelize');

// const env = process.env;
// console.log(env.npm_lifecycle_event, 'process.env');

const sequelize = new Sequelize('my_app', 'root', '123456', {
	host: '152.136.167.109',
	port: '3306',
	dialect: 'mysql',
});

async function callback() {
	try {
		await sequelize.authenticate();
		console.log('数据库连接成功！');
	} catch (error) {
		console.error('Unable to connect to the database:', error);
	}
}
callback();

module.exports = sequelize;
